import React, { Component } from 'react';
import { Link } from 'react-router-dom';

class U3D extends Component {

    componentDidMount () {
        // 加载unity3d动画
        document.getElementById("u3dFullScreen").innerHTML = '<object type="text/html" data="u3d.html" width="100%" height="100%"></object>';
    }

    render () {
        const toHomeStyle = {
            position:'absolute',
            // top:'5vh',
            // right:'5vh',
            top:'2vh',
            left:'130vh',
            color:'#fff',
            fontSize: '1.8vh',
            textDecoration:'none',
            width: '5vw',
            height: '3vh',
            border: '1px solid #909',
            display: 'flex',
            flexFlow: 'row nowrap',
            justifyContent: 'center',
            alignItems: 'center',
            background: '#909',
            borderRadius: '5px',
            opacity: '.7',
        }
        return (
            <div id='u3dFullScreen-container' style={{width:'100vw',height:'100vh',position:'relative'}}>
            <div id='u3dFullScreen' className='u3dFullScreen' style={{width: '100%',height:'100%'}}>

            </div>
            <Link to='/' 
                className='toHome' 
                style={toHomeStyle}>
                返回
            </Link>
        </div>
        );
    }

}

export default U3D;